/*
 * Copyright 2018 Shanxi Lu'an Taihang Laihui Net Tech co.,LTD.
 */
package src.com.bjsxt.base.sync007;

import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.LongAdder;

/**
 * Description:
 *
 * @author wzz
 * @since: 1.0
 * Create Date Time: 2018/12/5 10:16
 * Update Date Time:
 */
public class LongAddUse {

    public static LongAdder add = new LongAdder();
    public static AtomicInteger count = new AtomicInteger();

    public static int test(){
        add.increment();
        return add.intValue();
    }

    public static void main(String[] args) {


        for(int i=0;i<100;i++){
            new Thread(new Runnable() {
                @Override
                public void run() {
                    System.out.println(test());
                }
            }).start();
        }

    }
}
